Resident data ends at 4be0, program starts at 4be0, file ends at 1c5b4 Starting analysis pass at address 4be0 End of analysis pass, low address = 4be0, high address = 19b56 [Start of text] S001: "Lists And Lists" S002: " An Interactive Tutorial Copyright 1996 by Andrew Plotkin. (First-time players should type "about".) " S003: "951024" S004: "5/12" S005: "a" S006: "You can't go that way." S007: "the" S008: "the" S009: "the" S010: "the" S011: "the" S012: "the" S013: "the" S014: "the" S015: "the" S016: "the" S017: "the" S018: "the" S019: "Darkness" S020: "It is pitch dark, and you can't see a thing." S021: "As good-looking as ever." S022: "Nameless item" S023: "your former self" S024: "Everything here is just like it always is, except for that door." S025: "are" S026: "You've been that way before." S027: "that" S028: "is" S029: "The door isn't nearly so interesting from the inside." S030: "You expected puzzle-less IF?" S031: "The couch has that peculiar slump of cushion that says that this couch has seen much service, mostly to a single vast rear end. Indeed, the depression is perfectly molded to the tuchus that occupies it at this very moment." S032: "The computer is a bulky grey thing. It gives the distinct impression that it's full of vacuum tubes. The monitor is blank at the moment. However, the keyboard is surmounted by two painfully obvious buttons; the green one is labelled "run", and the yellow one is labelled "reset"." S033: "is" S034: "your" S035: "It's a small cube of frosted glass. Neatly etched on one side are the words "Break glass to wake owner." Something turns slowly inside the box... you can't quite see what." S036: ""How To Program In Lisp!"" S037: " *** You have won ***" S038: "What I Learned In 15-212" S039: "(Now, is your tongue numb?)" S040: "Table of Contents: 0: Introduction 1: What's Going On Here 2: What's An Atom? 3: What's a List? 4: Functions 5: Quoting Expressions 6: Defining Atoms 7: List Chopping 8: List Constructing 9: Tests and Logic 10: Comparisons 11: Conditionals 12: Creating Functions 13: Fun With Recursion 14: Local Definitions With Let 15: Recursion, Functions, Endless Fun 16: Scope 17: Return 18: Reference: Functions 19: Reference: Syntactic Forms 20: Reference: Improper Lists " S041: "A Simple Programmer's Introduction to Scheme" S042: "Introduction" S043: "What's Going On Here" S044: "What's An Atom?" S045: "What's a List?" S046: "Functions" S047: "Quoting Expressions" S048: "Defining Atoms" S049: "List Chopping" S050: "List Constructing" S051: "Tests and Logic" S052: "Comparisons" S053: "Conditionals" S054: "Creating Functions" S055: "Fun With Recursion" S056: "Local Definitions With Let" S057: "Recursion, Functions" S058: "Scope" S059: "Return" S060: "Reference: Functions" S061: "Reference: Syntactic Forms" S062: "Reference: Improper Lists" S063: "ITEM" S064: "0. Introduction" S065: "A Simple Programmer's Introduction to Scheme" S066: "1. What's Going On Here" S067: "5" S068: "5" S069: "5" S070: "5" S071: "don't" S072: "2. What's An Atom?" S073: "5" S074: "hello" S075: "-5" S076: "goodbye" S077: "darlene+mitchell" S078: "q-5" S079: "qq=5++qqq+" S080: "***" S081: "can't" S082: "(" S083: ")" S084: ";" S085: ":" S086: "'" S087: "." S088: "5" S089: "5" S090: "-597" S091: "-597" S092: "0" S093: "0" S094: "hello" S095: "[Error: undefined atom: hello]" S096: "q-5" S097: "[Error: undefined atom: q-5]" S098: "***" S099: "[Error: undefined atom: ***]" S100: "3. What's a List?" S101: "(1)" S102: "(2 fred)" S103: "(2 fred)" S104: "(fred 2)" S105: "()" S106: "nil" S107: "()" S108: "nil" S109: "()" S110: "(one (two) three)" S111: "(((one) 2 fred) xxxx9)" S112: "(())" S113: "(hello mr ((operator)))" S114: "hello" S115: "mr" S116: "((operator))" S117: "(operator)" S118: "operator" S119: "1" S120: "2" S121: "3" S122: "1 2 3 four" S123: "1" S124: "2" S125: "3" S126: "[Error: undefined atom: four]" S127: "4. Functions" S128: "(+ 1 1)" S129: "2" S130: "(+ 1 1)" S131: "1" S132: "1" S133: "2" S134: "(+ 1 1)" S135: "+" S136: "is" S137: "+" S138: "[function]" S139: "[function]" S140: "(- 1 1)" S141: "0" S142: "-" S143: "[function]" S144: "-" S145: "all" S146: "(+ (+ 1 1) 4)" S147: "+" S148: "(+ 1 1)" S149: "2" S150: "4" S151: "4" S152: "2" S153: "4" S154: "(+ (+ 1 1) 4)" S155: "6" S156: "(+ 1 1 4)" S157: "6" S158: "(1 2 3 4)" S159: "[Error: object is not a function: 1]" S160: "(spoggly 2 3 4)" S161: "[Error: undefined atom: spoggly]" S162: "()" S163: "nil" S164: "()" S165: "nil" S166: "nil" S167: "nil" S168: "5. Quoting Expressions" S169: "hello" S170: "hello" S171: "hello" S172: "[Error: undefined atom: hello]" S173: "(quote hello)" S174: "hello" S175: "quote" S176: "(quote (+ 1 1))" S177: "(+ 1 1)" S178: "quote" S179: "'hello" S180: "hello" S181: "'(+ 1 1)" S182: "(+ 1 1)" S183: "'5" S184: "5" S185: "'+" S186: "+" S187: "+" S188: "'+" S189: "(quote +)" S190: "+" S191: "quote" S192: "quote" S193: "not" S194: "quote" S195: "[syntax]" S196: "6. Defining Atoms" S197: "+" S198: "(define x 5)" S199: "5" S200: "define" S201: "define" S202: "define" S203: "define" S204: "define" S205: "x" S206: "5" S207: "x" S208: "5" S209: "x" S210: "5" S211: "(+ x 1)" S212: "6" S213: "x" S214: "bob" S215: "(define x bob)" S216: "[Error: undefined atom: bob]" S217: "define" S218: "is" S219: "atom" S220: "bob" S221: "value" S222: "bob" S223: "(define x 'bob)" S224: "bob" S225: "x" S226: "bob" S227: "(+ x 1)" S228: "[Error: +: non-numeric argument: bob]" S229: "'x" S230: "x" S231: "x" S232: "5" S233: "'x" S234: "x" S235: "(define + 5)" S236: "(define addify +)" S237: "[function]" S238: "(addify 5 6)" S239: "11" S240: "7. List Chopping" S241: "car" S242: "cdr" S243: "(a bb ccc)" S244: "a" S245: "(a bb ccc)" S246: "(bb ccc)" S247: "term" S248: "list" S249: "((1 2) x y z)" S250: "(1 2)" S251: "(hello)" S252: "nil" S253: "car" S254: "cdr" S255: "car" S256: "cdr" S257: "+" S258: "-" S259: "(car '(a bb ccc))" S260: "a" S261: "(cdr '(a bb ccc))" S262: "(bb ccc)" S263: "(car (a bb cc))" S264: "car" S265: "cdr" S266: "(car 'a)" S267: "[Error: car: bad argument: a]" S268: "(car '())" S269: "[Error: car: bad argument: nil]" S270: "a" S271: "8. List Constructing" S272: "cons" S273: "(cons 'aaa '(bb c))" S274: "(aaa bb c)" S275: "(cons 'aaa nil)" S276: "(aaa)" S277: "(cons (car '(x y z z y)) (cdr '(x y z z y)))" S278: "(x y z z y)" S279: "(define magic-word '(x y z z y))" S280: "(x y z z y)" S281: "magic-word" S282: "(x y z z y)" S283: "(cons (car magic-word) (cdr magic-word))" S284: "(x y z z y)" S285: "cons" S286: "(cons 'a 'b)" S287: "(a . b)" S288: "list" S289: "(list 'a 'zzz)" S290: "(a zzz)" S291: "(list 'a '(1 2 3) 'end)" S292: "(a (1 2 3) end)" S293: "(list)" S294: "nil" S295: "(list '() (+ 4 5) '(+ 1 2) (cdr magic-word))" S296: "(nil 9 (+ 1 2) (y z z y))" S297: "magic-word" S298: "9. Tests and Logic" S299: "=" S300: "(= 2 2)" S301: "t" S302: "(= 2 5)" S303: "nil" S304: "nil" S305: "t" S306: "t" S307: "nil" S308: "t" S309: "nil" S310: "<" S311: ">" S312: "<=" S313: ">=" S314: "null?" S315: "t" S316: "nil" S317: "nil" S318: "list?" S319: "t" S320: "nil" S321: "nil" S322: "(null? nil)" S323: "t" S324: "(null? t)" S325: "nil" S326: "(null? 0)" S327: "nil" S328: "(list? nil)" S329: "t" S330: "(list? 1)" S331: "nil" S332: "(list? 'a)" S333: "nil" S334: "(list? '(a))" S335: "t" S336: "10. Comparisons" S337: "=" S338: "eqv?" S339: "equal?" S340: "eqv?" S341: "equal?" S342: "eq?" S343: "nil" S344: "(eqv? 1 2)" S345: "nil" S346: "(eqv? 2 2)" S347: "t" S348: "(eqv? 'one 'two)" S349: "nil" S350: "(eqv? 'two 'two)" S351: "t" S352: "(eqv? 2 'two)" S353: "nil" S354: "(eqv? nil 'two)" S355: "nil" S356: "(eqv? nil nil)" S357: "t" S358: "equal?" S359: "eqv?" S360: "t" S361: "(define greeting '(hi there))" S362: "(hi there)" S363: "(define aloha (list 'hi 'there))" S364: "(hi there)" S365: "(eqv? greeting greeting)" S366: "t" S367: "(eqv? greeting '(hi there))" S368: "nil" S369: "(eqv? greeting aloha)" S370: "nil" S371: "(eqv? '(hi there) '(hi there))" S372: "nil" S373: "(define hug greeting)" S374: "(hi there)" S375: "(eqv? greeting hug)" S376: "t" S377: "(eqv? aloha hug)" S378: "nil" S379: "'(hi there)" S380: "(list 'hi 'there)" S381: "eqv?" S382: "(define hug greeting)" S383: "greeting" S384: "hug" S385: "are" S386: "eqv?" S387: "equal?" S388: "equal?" S389: "equal?" S390: "(equal? greeting greeting)" S391: "t" S392: "(equal? greeting '(hi there))" S393: "t" S394: "(equal? '(hi there) '(hi there))" S395: "t" S396: "(equal? greeting aloha)" S397: "t" S398: "(equal? greeting hug)" S399: "t" S400: "(equal? aloha hug)" S401: "t" S402: "eqv?" S403: "equal?" S404: "eqv?" S405: "eqv?" S406: "equal?" S407: "eqv?" S408: "equal?" S409: "tell" S410: "person" S411: "11. Conditionals" S412: "cond" S413: "cond" S414: " (cond" S415: " (test1 result1)" S416: " (test2 result2)" S417: " ..." S418: " )" S419: "cond" S420: "nil" S421: "nil" S422: "nil" S423: "nil" S424: " if (test1) return result1;" S425: " else if (test2) return result2;" S426: " ..." S427: " else return nil;" S428: "(t defaultresult)" S429: "t" S430: "(define val -25)" S431: "-25" S432: "(cond" S433: " ((> val 0) 'positive)" S434: " ((< val 0) 'negative)" S435: " (t 'zero)" S436: ")" S437: "negative" S438: "val" S439: "positive" S440: "negative" S441: "zero" S442: "12. Creating Functions" S443: "lambda" S444: "(lambda (n) (+ n 1))" S445: "[function]" S446: "(define fred (lambda (n) (+ n 1)))" S447: "[function]" S448: "(fred 56)" S449: "57" S450: "fred" S451: "56" S452: "(lambda (n) (+ n 1))" S453: "+" S454: "car" S455: "((lambda (n) (+ n 1)) 56)" S456: "57" S457: "lambda" S458: "kind" S459: "(define n 56)" S460: "56" S461: "(+ n 1)" S462: "57" S463: "56" S464: "n" S465: "to the function" S466: "n" S467: "(define n 11)" S468: "11" S469: "(fred 93)" S470: "94" S471: "n" S472: "11" S473: "(define greeter (lambda () 'hello))" S474: "[function]" S475: "(greeter)" S476: "hello" S477: "(greeter 5)" S478: "[Error: too many arguments to function]" S479: "+" S480: "lambda" S481: "(define prefix-foo (lambda args (cons 'foo args)))" S482: "[function]" S483: "(prefix-foo 5)" S484: "(foo 5)" S485: "(prefix-foo 'a 'bb 'ccc)" S486: "(foo a bb ccc)" S487: "(prefix-foo)" S488: "(foo)" S489: "13. Fun With Recursion" S490: "loves" S491: "last" S492: "(define last (lambda (ls)" S493: " (cond" S494: " ((null? (cdr ls)) (car ls))" S495: " (t (last (cdr ls)))" S496: ")))" S497: "last" S498: "ls" S499: "cond" S500: "(cdr ls)" S501: "null" S502: "(car ls)" S503: "(last (cdr ls))" S504: "(cdr ls)" S505: "nil" S506: "(null? (cdr ls))" S507: "(car ls)" S508: "last" S509: "ls" S510: "ls" S511: "(last '(a))" S512: "a" S513: "(last '(a bb))" S514: "bb" S515: "(last '(a bb c))" S516: "c" S517: "(last '(a bb c (xx)))" S518: "(xx)" S519: "14. Local Definitions With Let" S520: "let" S521: " (let" S522: " (" S523: " (atom1 value1)" S524: " (atom2 value2)" S525: " ..." S526: " )" S527: " result" S528: " )" S529: "let" S530: " ((lambda (atom1 atom2 ...) result) (value1 value2 ...))" S531: "let" S532: "(let" S533: " ((a 1) (b 2))" S534: " (+ a b)" S535: ")" S536: "3" S537: "(let" S538: " ((func car))" S539: " (func '(a b c))" S540: ")" S541: "a" S542: "(let" S543: " ((cost '(nickel dime)))" S544: " (eqv? cost cost)" S545: ")" S546: "t" S547: "a" S548: "[Error: undefined atom: a]" S549: "func" S550: "[Error: undefined atom: func]" S551: "cost" S552: "[Error: undefined atom: cost]" S553: "all" S554: "let" S555: "any" S556: "let" S557: "let*" S558: "let*" S559: "let" S560: "(let*" S561: " ((a 1) (b (+ a 1)))" S562: " b" S563: ")" S564: "2" S565: "let" S566: "a" S567: "(+ a 1)" S568: "15. Recursion, Functions, Endless Fun" S569: "let*" S570: "really" S571: "letrec" S572: "letrec" S573: "let" S574: "let*" S575: "inside lambda-expressions." S576: "(letrec" S577: " ((a a))" S578: " a" S579: ")" S580: "use" S581: "a" S582: "nil" S583: "letrec" S584: "letrec" S585: "letrec" S586: "can" S587: "letrec" S588: "(letrec" S589: " ((a (lambda () a)))" S590: " a" S591: ")" S592: "(lambda () a)" S593: "a" S594: "letrec" S595: "a" S596: "this" S597: "(define thing" S598: " (letrec" S599: " ((a (lambda () a)))" S600: " a" S601: " )" S602: ")" S603: "[function]" S604: "thing" S605: "letrec" S606: "a" S607: "a" S608: "a" S609: "itself" S610: "thing" S611: "[function]" S612: "(thing)" S613: "[function]" S614: "((thing))" S615: "[function]" S616: "(eqv? thing (thing))" S617: "t" S618: "eqv?" S619: "thing" S620: "(thing)" S621: "thing" S622: "thing" S623: "thing" S624: "let" S625: "letrec" S626: "(define thing" S627: " (let" S628: " ((a (lambda () a)))" S629: " a" S630: " )" S631: ")" S632: "[function]" S633: "(thing)" S634: "[Error: undefined atom: a]" S635: "let" S636: "a" S637: "has" S638: "a" S639: "a" S640: "let" S641: "letrec" S642: "letrec" S643: "16. Scope" S644: "let" S645: "let" S646: "define" S647: "(define selfer" S648: " (lambda () selfer)" S649: ")" S650: "[function]" S651: "selfer" S652: "(define another-selfer selfer)" S653: "[function]" S654: "(define selfer 'toast)" S655: "toast" S656: "(another-selfer)" S657: "toast" S658: "(eqv? another-selfer (another-selfer))" S659: "nil" S660: "thing" S661: "another-thing" S662: "thing" S663: "made" S664: "17. Return" S665: "The Scheme Programming Language," S666: "18. Reference: Functions" S667: "(car v)" S668: "v" S669: "(cdr v)" S670: "v" S671: "(cons v w)" S672: "v" S673: "w" S674: "(length v)" S675: "v" S676: "(list v ...)" S677: "(not v)" S678: "t" S679: "v" S680: "nil" S681: "nil" S682: "(eqv? v w)" S683: "t" S684: "v" S685: "w" S686: "nil" S687: "nil" S688: "(equal? v w)" S689: "t" S690: "v" S691: "w" S692: "eqv?" S693: "equal?" S694: "(null? v)" S695: "t" S696: "v" S697: "nil" S698: "nil" S699: "not" S700: "(list? v)" S701: "t" S702: "v" S703: "nil" S704: "nil" S705: "v" S706: "(= v ...)" S707: "t" S708: "t" S709: "(> v ...)" S710: "t" S711: "nil" S712: "t" S713: "(>= v ...)" S714: "t" S715: "nil" S716: "t" S717: "(< v ...)" S718: "t" S719: "nil" S720: "t" S721: "(<= v ...)" S722: "t" S723: "nil" S724: "t" S725: "(+ v ...)" S726: "0" S727: "(- v ...)" S728: "0" S729: "(eval v)" S730: "v" S731: "eval" S732: "eval" S733: "19. Reference: Syntactic Forms" S734: "(quote v)" S735: "v" S736: "(error ...)" S737: "(cond clause1 ...)" S738: "nil" S739: "nil" S740: "nil" S741: "nil" S742: "(define atom v)" S743: "v" S744: "atom" S745: "atom" S746: "(lambda arglist v)" S747: "arglist" S748: "v" S749: "arglist" S750: "nil" S751: "(let ((atom1 def1) ...) v)" S752: "v" S753: "(let* ((atom1 def1) ...) v)" S754: "def1" S755: "atom1" S756: "def2" S757: "atom2" S758: "v" S759: "(letrec ((atom1 def1) ...) v)" S760: "v" S761: "20. Reference: Improper Lists" S762: "cons" S763: "cons" S764: "'(a . b)" S765: "(a . b)" S766: "cons" S767: "(cons 'z '(a . b))" S768: "(z a . b)" S769: "(cons 'rats '(z a . b))" S770: "(rats z a . b)" S771: "isn't" S772: "is" S773: "'(a . (b c))" S774: "(a b c)" S775: "list?" S776: "Now" S777: "unable to set up the environment" S778: "unmatched right parenthesis" S779: "dot was used outside of a list" S780: "lambda: bad argument template" S781: "define: first argument is not an atom" S782: "let: first argument is not a list of lists" S783: "let: binding is not a list" S784: "let: binding must start with an atom" S785: "let: binding must contain a definition" S786: "letrec: first argument is not a list of lists" S787: "letrec: binding is not a list" S788: "letrec: binding must start with an atom" S789: "letrec: binding must contain a definition" S790: "let: first argument is not a list of lists" S791: "let: binding is not a list" S792: "let: binding must start with an atom" S793: "let: binding must contain a definition" S794: "length: not a proper list" S795: "car: bad argument" S796: "cdr: bad argument" S797: "cond: argument is not a list" S798: "cond: clause is not a list" S799: "cond: clause does not end in an expression" S800: "numeric compare: must have at least one argument" S801: "numeric compare: non-numeric argument" S802: "numeric compare: non-numeric argument" S803: "+: non-numeric argument" S804: "+: non-numeric argument" S805: "a dot must be followed by an object" S806: "only one object may follow a dot" S807: "ignoring quote before close parenthesis" S808: "ignoring quote before dot" S809: "(internal) zero-length atom name" S810: "computation interrupted" S811: "undefined atom" S812: "object is not a function" S813: "attempt to evaluate free memory" S814: "cannot evaluate object" S815: "(internal) too many arguments in built-in function" S816: "too many arguments to function" S817: "too few arguments to function" S818: "too many arguments to function" S819: "too few arguments to function" S820: "heap memory is full" S821: "(internal) attempt to free a garbage pointer" S822: "(internal) attempt to free a free block" S823: "garbage-collect: encountered free memory block in environment" S824: "garbage-collect: encountered unused memory block in environment" S825: "atom name memory is full" S826: "twentyseven" S827: "cat" S828: "dog" S829: "cat" S830: "dog" S831: "equal?" S832: "eqv?" S833: "cdr(cat)" S834: "cdr(dog)" S835: "eqv?" S836: "abs" S837: "(abs 4)" S838: "4" S839: "(abs -5)" S840: "5" S841: "(abs 0)" S842: "0" S843: "sum" S844: "(sum '(8 2 3))" S845: "13" S846: "(sum nil)" S847: "0" S848: "megasum" S849: "(megasum '((8) 5 (2 () (9 1) 3)))" S850: "28" S851: "max" S852: "(max '(5 14 -3))" S853: "14" S854: "pocket" S855: "pocket" S856: "nil" S857: "8" S858: "pocket" S859: "pocket" S860: "(pocket nil)" S861: "8" S862: "(pocket 12)" S863: "[function]" S864: "(define newpocket (pocket 12))" S865: "[function]" S866: "(newpocket nil)" S867: "12" S868: "(define thirdpocket (newpocket 3))" S869: "[function]" S870: "(thirdpocket nil)" S871: "3" S872: "(newpocket nil)" S873: "12" S874: "(pocket nil)" S875: "8" S876: "define" S877: "(define twentyseven 27)" S878: "27" S879: "twentyseven" S880: "define" S881: "cat" S882: "dog" S883: "equal?" S884: "eqv?" S885: "eqv?" S886: "cons" S887: "eqv?" S888: "(define tail '(end))" S889: "(define cat (cons 'head tail))" S890: "(define dog (cons 'head tail))" S891: "positive negative zero" S892: "(define abs (lambda (val)" S893: " (cond" S894: " ((> val 0) val)" S895: " ((< val 0) (- 0 val))" S896: " (t 0)" S897: " )))" S898: "last" S899: "sum" S900: "(define sum (lambda (s)" S901: " (cond" S902: " ((null? s) 0)" S903: " (t (+" S904: " (car s)" S905: " (sum (cdr s)))" S906: " ))))" S907: "megasum" S908: "sum" S909: "cond" S910: "list?" S911: "megasum" S912: "(define megasum (lambda (s)" S913: " (cond" S914: " ((null? s) 0)" S915: " (t (+" S916: " (cond" S917: " ((list? (car s)) (megasum (car s)))" S918: " (t (car s)))" S919: " (megasum (cdr s))))" S920: " )))" S921: "max" S922: "let" S923: "max" S924: "max" S925: "max" S926: "max" S927: "last" S928: "(define max (lambda (s)" S929: " (cond" S930: " ((null? (cdr s)) (car s))" S931: " (t (let" S932: " (" S933: " (hd (car s))" S934: " (tl (max (cdr s)))" S935: " )" S936: " (cond" S937: " ((> hd tl) hd)" S938: " (t tl)))))))" S939: "define" S940: "let" S941: "let" S942: "gen" S943: "(gen 5)" S944: "x" S945: "(lambda (y)" S946: " (cond" S947: " ((null? y) x)" S948: " (t (generator y))))" S949: "y" S950: "y" S951: "nil" S952: "x" S953: "y" S954: "letrec" S955: "(define pocket" S956: " (letrec" S957: " (" S958: " (generator (lambda (x)" S959: " (lambda (y)" S960: " (cond" S961: " ((null? y) x)" S962: " (t (generator y))))))" S963: " )" S964: " (generator 8)))" S965: "twentyseven" S966: "equal?" S967: "eqv?" S968: "cdr(cat)" S969: "cdr(dog)" S970: "eqv?" S971: "(define tail '(end))" S972: "(define cat (cons 'head tail))" S973: "(define dog (cons 'head tail))" S974: "eqv?" S975: "cat" S976: "dog" S977: "nil" S978: "nil" S979: "eqv?" S980: "nil" [End of text] [End of file]